﻿using System;

namespace TextEditor
{
    

    public class A_FontSize : A_Action
    {
        public override string ActionName()
        {
            return "fontsize";
        }

        public override A_Action Clone()
        {
            A_FontSize size = new A_FontSize();
            size.BaseCloneFrom(this);
            return size;
        }

        public override string getStr
        {
            get
            {
                ZYTextChar preChar = base.myOwnerDocument.Content.GetPreChar();
                if (preChar != null)
                    return preChar.FontSize.ToString();
                return "";
            }
        }

        public override bool Execute()
        {
            bool flag=false;
            try
            {
                base.myOwnerDocument.SetSelectionFontSize(Convert.ToInt32(base.Param1));
                flag = true;
            }
            catch
            {
            }
            return flag;
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.CanModify();
        }
    }
}

